Hey All,
I really do hate this REGEXP.
Ok, so here goes.
I want to make sure that a field starts out with "SSO ID: " <- obviously no quotes, but notice the spaces, hence why I put in quotes.
The SSO number is a 9 digits long.
So, I have tired this:
const Regexp UL_SSO_CHK = regexp2 "^SSO ID: 0-9{9}"
I have even tried:
const Regexp UL_SSO_CHK = regexp2 "^SSO ID: 0-90-90-90-90-90-90-90-90-9"
I do have fields that should match this every time, but are not matching.
Again, I have tried variations on the Regexp, but no good luck.
What is the world am I doing wrong? Why does this have to be so hard?
I just want to make sure the field starts with that and has a 9 digit SSO number.
I want to use Regexp because I will be using that same concept with other criteria.
Anybody have a nice Regexp tutorial that is very detailed on various criteria?
Thanks.
Jerry
SystemAdmin - Wed Aug 10 15:38:13 EDT 2011 |
|
Re: Another Regexp question SystemAdmin - Wed Aug 10 15:44:42 EDT 2011
I haven't done any regexp in dxl, so this may not be helpful at all, but have you tried adding square brackets around the 0-9?
const Regexp UL_SSO_CHK = regexp2 "^SSO ID: 0-9{9}"
|
|
Re: Another Regexp question SystemAdmin - Wed Aug 10 15:45:29 EDT 2011 SystemAdmin - Wed Aug 10 15:44:42 EDT 2011
I haven't done any regexp in dxl, so this may not be helpful at all, but have you tried adding square brackets around the 0-9?
const Regexp UL_SSO_CHK = regexp2 "^SSO ID: 0-9{9}"
Oh I see, the square brackets changed the format in the post.
|
|
Re: Another Regexp question dofstead - Wed Aug 10 16:53:47 EDT 2011
This seemed to work for me:
string x = "SSO ID: 123456789 more stuff"
const Regexp UL_SSO_CHK = regexp2 "^SSO ID: [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"
if (UL_SSO_CHK x) then {
ack "found"
} else {
ack "not found"
}
Dave
|
|
Re: Another Regexp question SystemAdmin - Wed Aug 10 17:10:54 EDT 2011 dofstead - Wed Aug 10 16:53:47 EDT 2011
This seemed to work for me:
string x = "SSO ID: 123456789 more stuff"
const Regexp UL_SSO_CHK = regexp2 "^SSO ID: [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"
if (UL_SSO_CHK x) then {
ack "found"
} else {
ack "not found"
}
Dave
Hi,
It seems to be working now for me.
I don't know what happened.
I am going nuts!!!
The only thing I did was close down the DXL editor, and then reopen and load the script.
It is now working perfectly.
I don't understnad why, but at least I know I was doing it right this time.
Thanks for the confirmation!
Jerry
|
|